#include<stdio.h>
int main()
{
	int n,sum=0,factorial=1;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) {
		factorial=factorial*i;
		sum+=factorial;
	}
	printf("%d\n",sum);
	return 0;
}
